package com.baizhi.service.impl;

import com.baizhi.entity.Book;
import com.baizhi.entity.Category;
import com.baizhi.mapper.BooksMapper;
import com.baizhi.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BooksServiceimpl implements BooksService {
    @Autowired
    private BooksMapper booksMapper;
    @Override
    public int insertbook(Book book) {
        return booksMapper.insertbook(book);
    }

    @Override
    public int deletebook(int id) {
        return booksMapper.deletebook(id);
    }

    @Override
    public int updatebook(Book book) {
        return booksMapper.updatebook(book);
    }

    @Override
    public List<Category> selectAllbook() {
        return booksMapper.selectAllbook();
    }

    @Override
    public int deletesbook(List<Integer> ids) {
        return booksMapper.deletesbook(ids);
    }

    @Override
    public List<Category> selectCategorysByPage(int offset, int rows) {
        return booksMapper.selectCategorysByPage((offset - 1) * rows, rows);
    }

    @Override
    public int selectToalCount() {
        return booksMapper.selectToalCount();
    }

    @Override
    public int deletecategory(Integer id) {
        return booksMapper.deletecategory(id);
    }
}
